#include <bits/c++config.h>
#include <ostream>
#include <string.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>

using namespace std;

class USD;
class CNY{
public:
    CNY(){}
    CNY(int value): _value(value){}
    CNY(const CNY &rhs):_value(rhs._value){}
    CNY(const USD &rhs);

    operator USD();
    CNY operator=(const USD &rhs);

    friend class USD;
    friend ostream &operator<<(ostream &os,const CNY &usd);
private:
    int _value=0;
};


class USD{
public:
    USD(){}
    USD(int value): _value(value){}
    USD(const USD &rhs):_value(rhs._value){}
    USD(const CNY &rhs);

    friend class CNY;
    friend ostream &operator<<(ostream &os,const USD &usd);
    operator CNY();
    USD operator=(const CNY&rhs);

private:
    int _value=0;
};

ostream &operator<<(ostream &os,const USD &usd){
    os<<usd._value;
    return os;
}
ostream &operator<<(ostream &os,const CNY &usd){
    os<<usd._value;
    return os;
}

CNY CNY::operator=(const USD &rhs){
    return CNY(rhs._value);
}

CNY::operator USD(){
    return USD(_value/7.2);
}

USD USD::operator=(const CNY &rhs){
    return USD(rhs._value/7.2);
}

USD::operator CNY(){
    return CNY(_value*7.2);
}

void test(){
    CNY c1(72);
    USD u2(10);
    cout<<"--- c1: "<<c1<<" ---"<<endl;
    cout<<"--- u2: "<<u2<<" ---"<<endl;

    USD u3=c1;
    cout<<"--- u3=c1: "<<u3<<" ---"<<endl;
    CNY c2=u3;
    USD u4(c2);

    cout<<"--- c2=u3: "<<c2<<" ---"<<endl;
    cout<<"--- u4(c2): "<<u4<<" ---"<<endl;
}

int main()
{
 test();
 return 0;
}

